﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Problem7
{
	// Find the 10001st prime.
	class Problem0007
	{
		static void Main(string[] args)
		{
			List<long> primes = new List<long>();
			int number = 2;
			while (primes.Count() != 10001)
			{
				bool isPrime = true;
				for (var j = 2; j < number; j++)
				{
					if (number % j == 0)
					{
						isPrime = false;
						break;
					}
				}
				if (isPrime)
				{
					primes.Add(number);
					primes.Sort();
				}
				number++;
			}
			primes.Sort();
			Console.WriteLine(primes.Last());
			Console.ReadLine();
		}
	}
}
